feat(git): enforce Conventional Commits format in commit message prompt#2123
feat(git): enforce Conventional Commits format in commit message prompt#2123pedrokpp wants to merge 2 commits into
Conversation
Replaces the loose subject rule with explicit Conventional Commits format (type(scope): description), consistent with the existing gitflow branch naming enforced by sanitizeFeatureBranchName.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 030b07b. Configure here.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Ran into this while using t3code — generated commit messages had no consistent structure, making history hard to scan and breaking tooling that expects a predictable format. A few other attempts exist for related problems:
Those are larger in scope. This PR does one thing: adds Conventional Commits rules to the prompt, consistent with the |
|
This is intentionally minimal — a temporary fix until there's a more robust solution for customizable commit conventions. A more flexible approach could be delegating style guidelines to the user's AGENTS.md, letting each project define its own commit conventions rather than hardcoding Conventional Commits. That said, happy to keep this simple and wait for feedback on the direction you'd prefer. |
ApprovabilityVerdict: Approved This change modifies AI prompt instructions to enforce Conventional Commits format for generated commit messages. It's a low-risk, self-contained change to documentation/prompt text with no runtime behavior impact beyond the format of generated commit messages. You can customize Macroscope's approvability policy. Learn more. |
|
This is like the one thing preventing me from using t3 as a daily driver. please merge! |

What changed
One rule in
buildCommitMessagePrompt(apps/server/src/git/Prompts.ts):Before:
After:
Why it should exist
t3code already enforces a naming convention for branches via
sanitizeFeatureBranchName(packages/shared/src/git.ts), which hard-codes thefeature/gitflow prefix on every generated branch. The same intent — consistent, predictable output — applies to commit messages.Right now the prompt produces freeform imperative subjects with no structure. Conventional Commits gives changelogs, tooling, and contributors a machine-readable signal without adding friction. It's the natural complement to the existing branch convention.
Closes #656.
Testing
Generate a commit message through the UI with staged changes and verify the output follows
type(scope): descriptionformat.Note
Low Risk
Low risk: only adjusts the LLM prompt text for generated commit messages, changing output formatting but not touching parsing, schemas, or git operations.
Overview
Updates
buildCommitMessagePromptinapps/server/src/git/Prompts.tsto require Conventional Commits subjects (type(scope): description) instead of a freeform imperative subject.The prompt now constrains
typetofeat|fix|docs|style|refactor|test|chore, keeps scope optional, and clarifies the no-trailing-period and ≤72-character subject limit.Reviewed by Cursor Bugbot for commit dabc6e5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Enforce Conventional Commits format in
buildCommitMessagePromptUpdates the prompt rules in Prompts.ts to require subjects in
type(scope): descriptionformat. The allowed types arefeat|fix|docs|style|refactor|test|chore, scope is optional, the description must be imperative with no trailing period, and the full subject line must be ≤72 characters. Behavioral Change: any AI-generated commit messages produced via this prompt will now follow Conventional Commits structure rather than free-form imperative style.Macroscope summarized dabc6e5.